package com.liujun.io.netty.ten.httpxml.code.ch01.response.decoder;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.DefaultFullHttpResponse;

import java.util.List;

import com.liujun.io.netty.ten.httpxml.code.ch01.request.decoder.AbstractHttpXmlDecoder;
import com.liujun.io.netty.ten.httpxml.code.ch01.response.HttpXmlResponse;

public class HttpXmlResponseDecoder
		extends
			AbstractHttpXmlDecoder<DefaultFullHttpResponse> {

	public HttpXmlResponseDecoder(Class<?> clazz) {
		this(clazz, false);
	}

	public HttpXmlResponseDecoder(Class<?> clazz, Boolean isPrintLog) {
		super(clazz, isPrintLog);
	}

	@Override
	protected void decode(ChannelHandlerContext ctx,
			DefaultFullHttpResponse msg, List<Object> out) throws Exception {
		HttpXmlResponse resHttpXmlResponse = new HttpXmlResponse(msg, decode0(
				ctx, msg.content()));
		out.add(resHttpXmlResponse);
	}

}
